package com.zfh.test;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import com.zfh.iterator.Iterator;
import com.zfh.iterator.Student;
import com.zfh.iterator.StudentGroup;

public class MainStudent {

	public static void main(String[] args) throws ParseException {

		StudentGroup studentGroup = new StudentGroup(5);
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		studentGroup.appendStudent(new Student("2019001001","李小明",sdf.parse("1979-09-09"),95.5));
		studentGroup.appendStudent(new Student("2019001002","王小明",sdf.parse("1978-08-09"),91.5));
		studentGroup.appendStudent(new Student("2019001003","刘小明",sdf.parse("1977-06-09"),92.5));
		studentGroup.appendStudent(new Student("2019001004","郑小明",sdf.parse("1976-05-09"),93.5));
		studentGroup.appendStudent(new Student("2019001005","周小明",sdf.parse("1975-04-09"),94.5));
		
		Iterator it = studentGroup.iterator();
		while (it.hasNext()) {
			Student student = (Student) it.next();
			System.out.println(student);
			
		}
	}

}
